lib/util: Delete some leftover pre-libglnx directory opening functions
authorColin Walters <walters@verbum.org>
Tue, 25 Apr 2017 01:12:21 +0000 (21:12 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 25 Apr 2017 13:30:07 +0000 (13:30 +0000)
These were migrated into libglnx; port the few callers to use that.

Closes: #808
Approved by: jlebon

src/libostree/ostree-repo.c
src/libostree/ostree-sysroot-deploy.c
src/libotutil/ot-fs-utils.c
src/libotutil/ot-fs-utils.h

index bfb9fb37e29c958b80fdf933fb862341f8ec9ff7..2df6a292da208462fcf9b3babdc87ef9fea816bd 100644 (file)
@@ -2465,7 +2465,7 @@ list_loose_objects (OstreeRepo                     *self,
       buf[0] = hexchars[c >> 4];
       buf[1] = hexchars[c & 0xF];
       buf[2] = '\0';
-      dfd = ot_opendirat (self->objects_dir_fd, buf, FALSE);
+      dfd = glnx_opendirat_with_errno (self->objects_dir_fd, buf, FALSE);
       if (dfd == -1)
         {
           if (errno == ENOENT)
index 6cf4b7eb9823a8ad542db9edb65feeace21f01d7..3a3dd4c9bb3f137fd63938100c5d6064db80aab3 100644 (file)
@@ -255,7 +255,7 @@ ensure_directory_from_template (int                 orig_etc_fd,
   g_assert (path != NULL);
   g_assert (*path != '/' && *path != '\0');
 
-  if (!ot_gopendirat (modified_etc_fd, path, TRUE, &src_dfd, error))
+  if (!glnx_opendirat (modified_etc_fd, path, TRUE, &src_dfd, error))
     goto out;
 
   /* Create with mode 0700, we'll fchmod/fchown later */
@@ -293,7 +293,7 @@ ensure_directory_from_template (int                 orig_etc_fd,
         }
     }
 
-  if (!ot_gopendirat (new_etc_fd, path, TRUE, &target_dfd, error))
+  if (!glnx_opendirat (new_etc_fd, path, TRUE, &target_dfd, error))
     goto out;
 
   if (!dirfd_copy_attributes_and_xattrs (modified_etc_fd, path, src_dfd, target_dfd,
index 4ecf820bee765e4df1ab3b06290ffa6e067c2c41..8ba2cffb6aa1d76c3d6fa3bfefe2b5dd2c4930a5 100644 (file)
@@ -35,32 +35,6 @@ ot_fdrel_to_gfile (int dfd, const char *path)
   return g_file_new_for_path (abspath);
 }
 
-int
-ot_opendirat (int dfd, const char *path, gboolean follow)
-{
-  int flags = O_RDONLY | O_NONBLOCK | O_DIRECTORY | O_CLOEXEC | O_NOCTTY;
-  if (!follow)
-    flags |= O_NOFOLLOW;
-  return openat (dfd, path, flags);
-}
-
-gboolean
-ot_gopendirat (int             dfd,
-               const char     *path,
-               gboolean        follow,
-               int            *out_fd,
-               GError        **error)
-{
-  int ret = ot_opendirat (dfd, path, follow);
-  if (ret == -1)
-    {
-      glnx_set_error_from_errno (error);
-      return FALSE;
-    }
-  *out_fd = ret;
-  return TRUE;
-}
-
 gboolean
 ot_readlinkat_gfile_info (int             dfd,
                           const char     *path,
index edf8b29aeaa1b9c86c9acfffd47a31deaed794b0..c777068204930187cc7d426aba3bf08f7e8590d4 100644 (file)
@@ -26,13 +26,6 @@ G_BEGIN_DECLS
 
 GFile * ot_fdrel_to_gfile (int dfd, const char *path);
 
-int ot_opendirat (int dfd, const char *path, gboolean follow);
-gboolean ot_gopendirat (int             dfd,
-                        const char     *path,
-                        gboolean        follow,
-                        int            *out_fd,
-                        GError        **error);
-
 gboolean ot_readlinkat_gfile_info (int             dfd,
                                    const char     *path,
                                    GFileInfo      *target_info,